package org.argetr.resim.proc;
import org.argetr.resim.proc.data.*;
/*
Definition
  Performs histogram equialization on image. 
Inputs
  ImageDA
Parameters
  -
Outputs
  ImageDA
 */
public class HistogramEqualizePR extends HistogramMatchPR {
	public Data process() {
		int nBands = getInputAsImageDA().getNBands();
	      float[][] CDFeq = new float[nBands][256];
        for (int j = 0; j < nBands; j++){
          for(int i = 0; i < 256; i++) {
              CDFeq[j][i] = (float)(i+1)/(float)256;
          }
        }
      HistogramMatchDA histMatchDA = new HistogramMatchDA(CDFeq);
      setParameters(histMatchDA);
      return super.process();
	}
}
